using Engine;
using Engine.Graphics;
using Game;

namespace SCIENEW {
    public class MoltenIronBlock : FocalorsFluidBlock {
        public const int Index = 519;

        public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z) {
            Color sideColor;
            Color topColor = sideColor = MaterialsUtils.GetMetalColor(Materials.Iron);
            GenerateFluidTerrainVertices(
                generator,
                value,
                x,
                y,
                z,
                sideColor,
                topColor,
                geometry.OpaqueSubsetsByFace
            );
        }

        /*
        public override IEnumerable<int> GetCreativeValues() {
            for (int i = 0; i < 8; i++) {
                yield return Terrain.MakeBlockValue(BlockIndex, 0, SetIsTop(SetLevel(0, i / 8f), true));
            }
        }
        */

        public override void DrawBlock(PrimitivesRenderer3D primitivesRenderer, int value, Color color, float size, ref Matrix matrix, DrawBlockEnvironmentData environmentData) {
            DrawFocalorsFluidBlock(
                primitivesRenderer,
                value,
                color * MaterialsUtils.GetMetalColor(Materials.Iron),
                size,
                ref matrix,
                environmentData
            );
        }

        public override int GetEmittedLightAmount(int value) => 15;
    }
}